Replace table columns with DIV and CSS using float?

I have a problem with div and css and especially floating point. I need to convert a heavy page using tables, columns and rows, my idea is to create a div for each column, but of course I need to float this.

What are the rules for swimming? Should I float each Div to the left until I get to the end, and then I have to "clear" the float?

Is it good to use Width / Height on the div, I can't swim them correctly? or is it better to use a minimum height?

Of course, my idea is to delete all the css materials in the external css style table, so I assume that I need to provide each div and ID so that I can give it float / style ... or, of course, if they are all So can I assign a css class?

Any help really appreciated

thanks

+3
source share
3 answers
<div id="mytable">
    <div class="left"></div>
    <div class="right"></div>
    <div class="clearer"></div>
</div>

<style>
   .left,.right {
      float:left;
      width:100px;
   }
   .clearer {
     clear:both;
     height:0;
   }
</style>

So I style my "tables", it works in all browsers.

+4
source

div css . , , - div , , , .

. , CSS , 100%.

? Div , , "" ?

:

<div style="float: left;">Column 1</div>
<div style="float: left;">Column 2</div>
<div>Column 3</div>
<div style="clear: left;">Stuff below the three columns</div>

Width/Height div, ? ?

It depends on whether you want the width / height to depend dynamically on the content or if you want it to be fixed. min-height can be useful in many cases, but I think the question is too general to be answered.

Of course, my idea is to delete all the css materials in the external css style table, so I assume that I need to provide each div and ID so that I can give it float / style ... or, of course, if they are all So can I assign a css class?

Yes.

0
source

Source: https://habr.com/ru/post/1725268/


All Articles