开发者

Is it possible to have a table with in a <td> but not constricted to that td's width

开发者 https://www.devze.com 2023-02-11 15:46 出处:网络
I want a table inside a <td>, but I don\'t want it to resize the <td>. I want it to over flow to next <td>开发者_C百科; on the right not but not resize the parent <td>.

I want a table inside a <td>, but I don't want it to resize the <td>. I want it to over flow to next <td>开发者_C百科; on the right not but not resize the parent <td>.

I'm putting it inside a <td> so it would move with it when the screen is resized.


Try this CSS code on the nested table:

position: absolute;
top: 0;
left: 0;

The parent TD should have:

position: relative;

But again, playing like this with TABLES is not recommended... You may need to nest the table in some DIV because positionning TABLES and TD is tricky.


Just have a single td and use colspan=2 for it. Keep the table left aligned and set its width to auto so that it can freely overflow to the right if it exceeds in size.

But since you've tagged this question under CSS, using tables for presentation and layout isn't a great way to do it.


This should do the trick:

<tr>...
   <td colspan="2">
      <table>content</table>
   </td>
    ...
</tr>

:)

0

精彩评论

暂无评论...
验证码 换一张
取 消