2016-09-30 290 views
0

目前,我有这样的:如何减少区域的宽度?

enter image description here

我想划定3个元素有这样的事情:

enter image description here

<th class="fc-day-header fc-widget-header fc-sat" data-date="2016-10-01">JOUR 1<br>samedi 1 octobre</th> 

我试图减少宽度的fc-day-header类,但没有任何改变。

我在CSS上很糟糕,所以我不知道该怎么做。

有想法吗?

编辑:HTML结构:

<table> 
    <thead> 
    <tr> 
     <th class="fc-axis fc-widget-header" style="width:18px"></th><th class="fc-day-header fc-widget-header fc-sat" data-date="2016-10-01" style="width:70%;">JOUR 1<br>samedi 1 octobre</th> 
     <th class="fc-day-header fc-widget-header fc-sun" data-date="2016-10-02">JOUR 2<br>dimanche 2 octobre</th> 
     <th class="fc-day-header fc-widget-header fc-mon" data-date="2016-10-03">JOUR 3<br>lundi 3 octobre</th> 
    </tr> 
    </thead> 
</table> 

HTML和CSS的是不是我的,它们是由完整的日历生成。

我只能通过javascript修改它们。

+0

许多想法...使用3周的div ...使用3个跨...使用3华里....不要使用表....使用Flexbox的....使用float ...使用inline-block .... Whitout看到足够的代码很难帮助你。 – DaniP

+0

为您的单元格添加边距。对于具体的建议,我们需要看看你到目前为止的CSS。 – theJoi

+1

向我们展示html结构 – Keith

回答

1

您可以使用border-spacing属性来分隔出每个单元格。

https://jsfiddle.net/3xe5mzmx/

<table> 
    <thead> 
    <tr> 
     <th class="fc-axis fc-widget-header" style="width:18px"></th> 
     <th class="fc-day-header fc-widget-header fc-sat" data-date="2016-10-01">JOUR 1<br>samedi 1 octobre</th> 
     <th class="fc-day-header fc-widget-header fc-sun" data-date="2016-10-02">JOUR 2<br>dimanche 2 octobre</th> 
     <th class="fc-day-header fc-widget-header fc-mon" data-date="2016-10-03">JOUR 3<br>lundi 3 octobre</th> 
    </tr> 
    </thead> 
</table> 

table { 
    width: 100%; 
    border-spacing: 15px 10px; 
    border-collapse: separate; 
} 
th { 
    border: 1px solid black; 
} 
0

您应该使用3个独立的div s,即使用margin-leftmargin right

+0

我无法做到这一点,它是动态生成的,它是一个日历..它甚至不是我的完整日历。 –

+0

@DimitriDanilov - 当你没有发布任何代码并且没有关于你正在使用的细节时,任何人都应该知道这一点。 – j08691

+0

你是什么意思?“它甚至不是我的完整日历。”?你有权访问代码吗?编辑:好吧,我得到你。 – Vincent