以相等的间距并排放置两张桌子 [英] Putting two tables side-by-side with equal spacing

查看:98
本文介绍了以相等的间距并排放置两张桌子的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对Stack Overflow还是很陌生,并且仍在学习编程.我想以相等的间距并排放置两张桌子,并防止桌子碰到页面的两边.我写了这段代码,但是没有得到正确的结果:

I'm quite new to Stack Overflow and am still learning programming. I would like to put two tables side-by-side with equal spacing and prevent the tables from touching the sides of the page. I wrote this code, but am not getting the right result:

<table style="float:right; background-color: white;font-family: cursive,sans-serif; border-radius: 8%; border-color: white" border="0" width="420px" height="216px" >

    <tr style='float: left; background-color: white; border-radius: 3%; border-color: white;' width='200px' height='54px'>
        <td style='font-family: cursive,sans-serif; border-color: white; ;' width='200px' height='54px'>From</td>
        <td style="font-family: cursive,sans-serif; border-color: white; border-radius: 3%" width='200px' height='54px'>To</td>
    </tr>
</table>


<table align="center" style=" float:left; background-color: white;font-family: cursive,sans-serif; border-radius: 8%; border-color: white" border="1" width="420px" height="216px">

</table>

推荐答案

欢迎!

  1. 首先将样式移动到.css文件中.
  2. 我整理了一个小样,查看-不用管表格了: nth-child(2n)选择器,也可以是类名.
  1. Move your styles into a .css file first of all.
  2. I put together a little demo, check it out - don't mind the table:nth-child(2n) selectors, those could also be class names.

这篇关于以相等的间距并排放置两张桌子的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆