I have a table with dynamic data.
Depending on data, it expands or collapses.
I don't want it. I want a fixed width that never expand or collapse.
How can I do that?
I've already tried <table width="300px"></table>
,
but it doesn't work.
By using CSS, the styling of HTML elements is easy to modify. To fix the width of td tag the nth-child CSS is used to set the property of specific columns(determined by the value of n) in each row of the table.
Click on the “Table” tab. Click the “Options” button. On the “Table Options” dialog box, in the “Options” section, click the “Automatically resize to fit contents” check box so there is NO check mark in the box.
To set the table width in HTML, use the style attribute. The style attribute specifies an inline style for an element. The attribute is used with the HTML <table> tag, with the CSS property width.
The following should work:
<table style="width:300px;table-layout:fixed"></table>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With