【发布时间】:2016-02-14 19:55:28
【问题描述】:
我正在尝试创建一个新闻网站,其中的新闻应该以图片和小文本的形式表示,当您单击它时,将打开一个代表整个新闻的新页面,所以我在想最好的方法来做到这一点,我应该做一个有一行图像和一行文本或列表的 html 表吗?或者它应该在一个 sql 表中,我用 php 调用它?
当我想发布一些新消息时,我想要一些易于添加的内容。我把它做成了一张桌子,但我不确定这是不是正确的做法。当我想添加新新闻时,我不想删除旧新闻我只想在向下滚动页面时显示旧新闻,这是表格的代码,很简单。
<table id="context_table" cellspacing="5" border="2" cellpadding="0" style="display: inline-block;">
<tr valign="top" align="right">
<td width="200" ><img src="paper.gif" alt="paper" height="115" /></td>
<td width="1" bgcolor=black><BR></td>
<td width="600" valign="top" align="left">
<p>Here is the news</p>
<p>news discription</p>
<tr valign="top" align="right">
<td width="200"><img src="1920x1920.jpg" alt="film" height="115" /></td>
<td width="1" bgcolor=black><BR></td>
<td width="600" valign="top" align="left">
<p>Here is the news</p>
<p>blah<br>blah<br>blah</p>
<tr valign="top" align="right">
<td width="200"><p>pictures</p></td>
<td width="1" bgcolor=black><BR></td>
<td width="600" valign="top" align="left">
<p>Here is the news</p>
<p>news discription</p>
<tr valign="top" align="right">
<td width="200"><p>pictures</p></td>
<td width="1" bgcolor=black><BR></td>
<td width="600" valign="top" align="left">
<p>Here is the news</p>
<p>blah<br>blah<br>blah</p>
<tr valign="top" align="right">
<td width="200"><p>pictures</p></td>
<td width="1" bgcolor=black><BR></td>
<td width="600" valign="top" align="left">
<p>Here is the news</p>
<p>blah<br>blah<br>blah</p>
<tr valign="top" align="right">
<td width="200"><p>pictures</p></td>
<td width="1" bgcolor=black><BR></td>
<td width="600" valign="top" align="left">
<p>Here is the news</p>
<p>blah<br>blah<br>blah</p>
<tr valign="top" align="right">
<td width="200"><p>pictures</p></td>
<td width="1" bgcolor=black><BR></td>
<td width="600" valign="top" align="left">
<p>Here is the news</p>
<p>blah<br>blah<br>blah</p>
<tr valign="top" align="right">
<td width="200"><p>pictures</p></td>
<td width="1" bgcolor=black><BR></td>
<td width="600" valign="top" align="left">
<p>Here is the news</p>
<p>blah<br>blah<br>blah</p>
</td>
</tr>
【问题讨论】:
-
我建议安装一个cms。
-
是的,像 drupal 这样的 cms 会显着缓解压力
-
我还建议使用现代语义 HTML5 标签和 CSS,而不是世纪之交基于表格的布局。
-
它是一个类,所以我必须通过编码来完成
-
您应该考虑将
<article></article>用于新闻项目而不是表格行
标签: javascript php html