我正在开发一个基于表格布局(没有div)的网站。现在需求改变,必须重新创建网站以便它看起来是响应式的,并且我们选择了Bootstrap作为响应式解决方案。
那么,我该如何将表格布局转换为Bootstrap网格布局,以使其既不改变外观,又具有响应式功能呢?
在网站中,表格布局过于复杂,有很多嵌套。例如:
<table border="0" width='100%' bgcolor='#ff00ff'>
<tr style='padding-bottom:1em;'>
<td>
<table border="0">
<tr valign='bottom'>
<td width='50'> </td>
<td>
<img border="0" src="#" width="100" height="300">
</td>
<td width='25'> </td>
<td>
<span style='font-size:10px;color:#cccccc;'>Alpha testing</span>
</td>
</tr>
</table>
</td>
<td align='right'>
<table border="0" cellspacing="0">
<tr>
<td align='center' colspan='3'>
<span>Another tesing text</span>
<span style='color:#FFFFCC;'> - </span>
<span style='font-size:11px;color:#fffff;'>Random text</span>
</td>
</tr>
</table>
</td>
</tr>
例如,我如何使用Bootstrap的row
,col-* - *
网格布局转换上面的代码。相信我,我尝试了很多次去转换它,但有时外观会改变,有时根本不起作用。
欢迎提出有关如何将基于表格的布局转换为Bootstrap的一般建议。