【发布时间】:2011-11-23 15:16:22
【问题描述】:
当您访问页面内容链接时,请获取下面的示例代码并提交。您会注意到子表source_code 并没有一直向右延伸。如果我将width: 100% 添加到syntax_table 类中,它可以解决问题,但source_code 表向右对齐,我无法让它向左移动。
我花了大约 2 个小时试图修复它,我现在需要一些帮助。
这里是一些 C# 示例代码:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using Microsoft.Phone.Controls;
namespace Test1
{
public partial class MainPage : PhoneApplicationPage
{
// Constructor
public MainPage()
{
InitializeComponent();
}
/// <summary>
/// Calculate method.
/// </summary>
/// <param name="sender">Sender</param>
/// <param name="e">Event Arguments</param>
private void btnCalculate_Click(object sender, RoutedEventArgs e)
{
double weight;
int heightf, heighti;
Double.TryParse(this.txtWeight.Text, out weight);
Int32.TryParse(this.txtHeightF.Text, out heightf);
Int32.TryParse(this.txtHeightI.Text, out heighti);
if (!(heightf >= 1))
MessageBox.Show("A person is at least 1 foot tall.");
else if (!(weight >= 1.0))
MessageBox.Show("A person cannot weigh nothing.");
else if (heightf >= 12)
MessageBox.Show("A person is not taller than 12 feet.");
else
{
double kg = weight * 0.45359237;
int height = heighti + (heightf * 12);
double bmi = weight / (height * height) * 703;
double gbmi = Math.Round(bmi, 1);
this.txtBMI.Text = bmi.ToString("n1");
}
}
}
}
【问题讨论】:
-
重读原文,我认为我没有完全理解这个问题 - 你能发布生成的 HTML/CSS 代码,这样我就可以把它放在一个页面中,然后看看问题所在吗?谢谢!
标签: c# css width syntax-highlighting