小编phe*_*mix的帖子

如何根据其文本内容动态设置html表列的宽度?

有一个html table

<table width="100%" border="0" cellspacing="0" cellpadding="0">
   <tr>
      <td width="480px"  class="societe" ><div style="float:left;font-size:12px;padding-top:2px" ><?php echo $_SESSION[PROJET_REF] ?> - [<?php echo $_SESSION[MANUEL_REF] ?>]</div>
      </td>
   </tr>
   ...
</table>
Run Code Online (Sandbox Code Playgroud)

css“兴业”是:

.societe{

    text-align:left;
    padding-left:23px;
    font-size:11px;
    font-weight:bold;

    background: url(../include/images/societe.png) repeat-x;

    }
Run Code Online (Sandbox Code Playgroud)

column定义中:<td width="480px" class="societe" >我将列的宽度硬编码为480px。这样做不是很好!那么如何动态地使宽度适合列的文本宽度呢?这里的文字是<?php echo $_SESSION[PROJET_REF] ?> - [<?php echo $_SESSION[MANUEL_REF] ?>

html css xhtml pixel font-size

4
推荐指数
1
解决办法
6万
查看次数

如何使用 Genymotion 在 PC 上启动 Android 应用程序?

我使用 android-bundle 中的 eclipse ADT 创建了一个 android 项目,并生成了 apk。我在运行 Windows XP 的计算机上下载并安装了带有集成 Oracle Virtualbox 的 Genymotion。如何使用 Genymotion 运行我的应用程序?

android android-emulator genymotion

4
推荐指数
1
解决办法
2万
查看次数

如何将换行符作为单元格的数据插入?

我使用Apache POI 3.16创建一个Excel文件.我想将特定单元格内的数据设置为有一个换行符:

rowConsommationEtRealisation.createCell(0).setCellValue("Consommation (crédits)\r\nRéalisation (produits)");
Run Code Online (Sandbox Code Playgroud)

当我打开文件时,单元格值没有换行!那么如何创建换行?

spring spring-mvc apache-poi

4
推荐指数
2
解决办法
5860
查看次数

重要的tc服务器不包含在STS 4中

我为Windows 10 64bit安装了STS 4,当我尝试创建服务器时,Pivotal不存在!如何在STS 4中包括Pivotal服务器?

spring-tool-suite tcserver

4
推荐指数
1
解决办法
1277
查看次数

如何设置HTML文件字段的值?

注意:

下面的答案和评论反映了2009年遗留浏览器的状态.现在,您可以在2017年使用JavaScript动态/编程地设置文件输入元素的值.

有关详细信息和演示,请参阅此问题中的答案:
如何以编程方式设置文件输入值(即:拖放文件时)?

在HTML中,我们可以通过编写来设置文本字段的值:

<input type="text" name="doc_intitule" maxlength="100" size="24" value="<?php echo $ret['doc_intitule']; ?>">
Run Code Online (Sandbox Code Playgroud)

但是如何设置file字段的值?

html php

3
推荐指数
1
解决办法
1万
查看次数

如何设置多个选择的宽度?

我想设置多个选择元素的默认宽度:

在此输入图像描述

怎么做 ?

html html5

3
推荐指数
1
解决办法
2万
查看次数

如何创建包含ListView的tabHost?

在文档中,据说TabActivity不推荐使用:在此输入链接描述.我跟着他们的例子使用了FragmentTabHost它,但它也崩溃了.所以我尝试创建一个简单的activity并添加一个intent作为内容TabSpec,但应用程序崩溃了!那么如何创建一个TabHost包含ListView

这是我做的:

@Override
    public void onCreate(Bundle savedInstanceState) {

        super.onCreate(savedInstanceState);

        setContentView(R.layout.onglet_parcelle_batiment);

        mTabHost = (TabHost)findViewById(R.id.onglets);

        mTabHost.setup();

        Bundle dataSent = getIntent().getExtras();

        bien_code = dataSent.getString("bien_code");

        afficherOngletParcelle();

        afficherOngletBatiments();

        mTabHost.setCurrentTab(0);

    }

    private void afficherOngletParcelle() {

        TabHost.TabSpec parcelle = mTabHost.newTabSpec("parcelle");
        View onglet = getLayoutInflater().inflate(R.layout.template_tab_onglets, null);
        TextView label = (TextView) onglet.findViewById(R.id.tabLabel);
        label.setText(getResources().getString(R.string.parcelle));
        parcelle.setIndicator(onglet);
        Intent i = new Intent(OngletParcelleListeBatiments.this, ParcelleActivity.class);
        i = i.putExtra("bien_code", bien_code);
        parcelle.setContent(i);
        mTabHost.addTab(parcelle);

    }

    private void afficherOngletBatiments() {

        TabHost.TabSpec batiment …
Run Code Online (Sandbox Code Playgroud)

android

3
推荐指数
1
解决办法
2411
查看次数

如何关闭 phalcon 数据库连接?

我创建了一个connection以插入数据并返回自动增量列的最后插入的 id :

function add($tab) {

        $champs= "";
        $value = "";
        $separateur ="";

        $tab["commande_date"] = convertDateFormat5($tab["commande_date"]);

        foreach ($tab as $k => $v){
            if ($k == "salle_code" || $k == "table_code")
                continue;
            $champs .= $separateur . $k;
            $value .= $separateur . "'" . $v . "'";
            $separateur = ",";
        }
        $champs = '('.$champs.')';
        $value = '('.$value.')';

        $sSQL = "INSERT INTO Commande $champs VALUES $value";

        $config = array(
                        "host" => "localhost",
                        "dbname" => BDD,
                        "port" => 3306,
                        "username" => "root", …
Run Code Online (Sandbox Code Playgroud)

php phalcon

3
推荐指数
1
解决办法
1083
查看次数

无法解析导入javax.servlet.ServletRegistration

我使用Spring Tool Suite3.8.1.RELEASE创建一个Spring集成Hibernate 的项目.我按照本网站教程进行操作.当我尝试创建第一步中提到的类时1.引导Spring Dispatcher Servlet然后我得到一个错误说The import javax.servlet.ServletRegistration cannot be resolved.这是pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.ambre</groupId>
    <artifactId>hib</artifactId>
    <name>SpringMvcHibernateJavaBased</name>
    <packaging>war</packaging>
    <version>1.0.0-BUILD-SNAPSHOT</version>
    <properties>
        <java-version>1.7</java-version>
        <org.springframework-version>4.0.3.RELEASE</org.springframework-version>
        <org.aspectj-version>1.6.10</org.aspectj-version>
        <org.slf4j-version>1.6.6</org.slf4j-version>
    </properties>
    <dependencies>
        <!-- Spring -->
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-context</artifactId>
            <version>${org.springframework-version}</version>
            <exclusions>
                <!-- Exclude Commons Logging in favor of SLF4j -->
                <exclusion>
                    <groupId>commons-logging</groupId>
                    <artifactId>commons-logging</artifactId>
                 </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-webmvc</artifactId>
            <version>${org.springframework-version}</version>
        </dependency>
        <dependency>
            <groupId>org.springframework</groupId>
            <artifactId>spring-orm</artifactId>
            <version>${org.springframework-version}</version>
            <type>jar</type>
            <scope>compile</scope>
        </dependency>

        <dependency> …
Run Code Online (Sandbox Code Playgroud)

java spring spring-mvc spring-tool-suite

3
推荐指数
1
解决办法
4081
查看次数

`${variableName}` 和 {variableName} 有什么区别?

这两种语法是否相同:`${variableName}` 和 {variableName}

javascript jsx reactjs

3
推荐指数
1
解决办法
141
查看次数