Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

How to restrict width div element into table element

I have css file

table {
  border: 1px solid;
  width: 400px;
}

And i have html file

<link rel="stylesheet" href="mytablediv.css">
<table><tr><td>table</td></tr></table>
<table><tr><td><div style="width:1000px;">div</div></td></tr></table>

I can’t change html file but i can change css file.

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

How to restrict width div element into table element and make it 400px?

I tried div{ max-width:100% !important;} and it dont’t work.
Width of table with div is 1000px but i need 400 px.

>Solution :

Its just a valid solution, because you cant change the html!

table div {  width: 100% !important; }
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading